package cn.com.cis.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cis.domain.Connection;
import cn.com.cis.persistence.ConnectionMapper;
import cn.com.cis.plugins.mybatis.PageHelper;

@Service
@Transactional
public class ConnectionService {

    @Autowired
    private ConnectionMapper mapper;

	public void insertConnection(Connection bean) {
		mapper.insertConnection(bean);
	}

	public List<Connection> selectAllConnections(int page, int pageSize) {
		PageHelper.startPage(page, pageSize);
		return mapper.selectAllConnections();
	}

	public Connection selectConnection(int id) {
		return mapper.selectConnection(id);
	}

	public void updateConnection(Connection bean) {
		mapper.updateConnection(bean);
	}

	public void deleteConnection(int id) {
		mapper.deleteConnection(id);
	}

}
